<?

//connect to db and get all necessary data
//require("../misc.php");

$CHtml  = new CGHtml;
$CJs    = new CGJavascript;

$COracle = new oracleDb;
$COracle->init($_SESSION["ORCL"],
               $_SESSION["OPASS"],
               $_SESSION["SID"],
               _NO_COMMENT);

if ($COracle->connect()) {

	$thisMdl   = "PURCHASE";
	$mdlNumber = "43";

  $srcDbCategory      = "MST_MODEL_CAT";
  $srcDbGroup         = "MST_MODEL_GRP";
	$srcDbHdr			      = "PCH_HDR";
  $srcDbHdrLog	      = "LOG_PCH_HDR";
  $srcDbDtl           = "PCH_DTL";
  $srcDbSubDtl        = "PCH_SUB_DTL";

	$optPrivs = "";
  if($UID->getPrivsByNumber( $mdlNumber, _VIEW_RIGHTS) > 0){

    $optPrivs .=  "  <td> ".$CHtml->formInputButton("<font size='5'>View</font>", // The label
                                                     "view",                       // var Name
                                                     "View",                       // var value
                                                     $entryBoxStyle)." </td>\n";   // var properties
  }
  if($UID->getPrivsByNumber( $mdlNumber, _EDIT_RIGHTS) > 0){

    $optPrivs .=  "  <td> ".$CHtml->formInputButton( "<font size='5'>Modify</font>", // The label
                                                      "modify",                       // var Name
                                                      "Modify",                       // var value
                                                      $entryBoxStyle)." </td>\n";     // var properties
  }
  if($UID->getPrivsByNumber( $mdlNumber, _APPROVE_RIGHTS) > 0){

    $optPrivs .=  "  <td> ".$CHtml->formInputButton( "<font size='5'>Approve</font>", // The label
                                                      "approve",                       // var Name
                                                      "Approve",                       // var value
                                                      $entryBoxStyle)." </td>\n";      // var properties
  }
  if($UID->getPrivsByNumber( $mdlNumber, _CANCEL_RIGHTS) > 0){

    $optPrivs .=  "  <td> ".$CHtml->formInputButton( "<font size='5'>Cancel</font>", // The label
                                                      "cancel",                       // var Name
                                                      "Cancel",                       // var value
                                                      $entryBoxStyle)." </td>\n";     // var properties
  }
  if($UID->getPrivsByNumber( $mdlNumber, _DELETE_RIGHTS) > 0){

    $optPrivs .=  "  <td> ".$CHtml->formInputButton( "<font size='5'>Delete</font>", // The label
                                                      "delete",                       // var Name
                                                      "Delete",                       // var value
                                                      $entryBoxStyle)." </td>\n";     // var properties
  }

  $jobId = $_POST["radioview"];

	if($_POST["transVariable"] != true){

  	echo  "<link rel=\"stylesheet\" type=\"text/css\" href=\"../myMenu.css\"/>\n".

  			  /**
          * This module js
          *
          */
  			  "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"javascript/misc.js\"></SCRIPT> \n".
  			  "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"javascript/ajax.js\"></SCRIPT> \n".

  	      "<form action=viewdboredit.php name='crtList' method=post>\n".
  				"<table border='1'>\n".
  				"<tr>\n".
  				"<input type='submit' value='back' name='back'>\n".
  			  $optPrivs.
  			  "<input type='hidden' name='radioview' value='".$_POST["radioview"]."'>\n".
  			  "<input type='hidden' name='selbox[]'  value='".$_POST["radioview"]."'>\n".
  				"</tr>\n".
  				"</table>\n".
  				"</form>\n";

  }else{

    /* Do nothing */
  }

  require("views/view_html.php");
}else{

	usrDie("Oracle connection Failed!");
	OUT();
}


?>